
# coding: utf-8

# In[1]:

import numpy as np


# In[2]:

# 8 - Reverse a vector (first element becomes last) (将数组逆序)
arr1 = [eval(i) for i in input().strip().split()]
print(sorted(arr1,reverse=True))
print(arr1[::-1])


# In[3]:

#15 - Create a 2d array with 1 on the border and 0 inside (创建2维数组，边界处元素值为1而内部元素值为0)
arr2 = np.ones((10,10))
arr2[1:-1,1:-1] = 0
print(arr2)


# In[4]:

# 19 - Create a 8x8 matrix and fill it with a checkerboard pattern (创建8x8的2维数组，按照棋盘的黑白相间的格式以1和0交替填充该数组)
arr3 = np.ones((8,8),dtype = int)
arr3[1::2, ::2] = 0
arr3[::2,1::2] = 0
#[::2]按步长为 2 取索引 0 到末尾 之间的元素，也就是第一列和第三列，等价为[0::2]
#[1::2]按步长为2，取索引1到末尾之间的元素
print(arr3)


# In[17]:

#70 - Consider the vector [1, 2, 3, 4, 5], how to build a new vector with 3 consecutive zeros interleaved between each value? 
# (现有数组[1，2，3，4，5]，如何构建新数组，在原数组的每两个数之间插入3个连续的0)
arr4 = np.array([1,2,3,4,5])
arr5 = np.zeros(len(arr4) + (len(arr4)-1)*3)
arr5[::4] = arr4
print(arr5)

